<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Admin_Controller extends MY_Controller
{
	public $theme_name;
	public $theme_url;
	public $theme_path;
	public $layout;
	
	public function __construct()
	{
		parent::__construct();
		$this->load->library('DX_Auth');
		$this->load->library('Meta');
		$this->load->helper('auth');
		
		$this->theme_name 		= "simpeg";
		$this->theme_url 		= _URL . "themes/{$this->theme_name}/";
		$this->theme_path 		= _ROOT . "themes/{$this->theme_name}/";
		$this->layout			= "../../themes/{$this->theme_name}/layout_main.php";
		$this->layout_content	= "../../themes/{$this->theme_name}/layout_content.php";
		$this->layout_restricted = "../../themes/{$this->theme_name}/layout_restricted.php";
		
		$allow_root = check_user('Root', false);
		if( !$allow_root )
		{
			$this->dx_auth->logout();
			redirect( _URL , "refresh");
			exit();	
		}
		
		
		if( !$this->dx_auth->is_logged_in() ){
			//redirect( _URL );
			echo '<script type="text/javascript">var parentBody = window.parent.document;parentBody.location.href = "'._URL.'";</script>';
			exit();
		}
		
		$this->load->driver('cache', array('adapter' => 'apc', 'backup' => 'file'));
	}
	
		
}